<?php
/**
 * Created by PhpStorm.
 * User: Mysic
 * Date: 2020/10/20
 * Time: 15:48
 */

namespace app\common\mysic\order;


use app\common\model\Order;

use app\common\mysic\MysicBase;
use think\Model;

class UserOrderOp extends MysicBase
{
    /**
     * @var Order
     */
    protected $model;
    /**
     * @var Order
     */

    protected $entity;
    protected $order;
    public function setModel(Model $model)
    {
        $this->model = $model;
        return $this;
    }
    public function getModel()
    {
        return $this->model;
    }

    public function setEntity($entity)
    {
        $this->entity = $entity;
        return $this;
    }

    public function success()
    {
        return $this->update(['is_abouns' => 1]);
    }

    public function update(array $data)
    {
        return $this->entity->isUpdate(true)->data($data)->save();

    }
}